export const stateMapping = [
    {
        name: "待派单",
        color: "#8080FF",
        tips: "等待派单中...",
        workOrderState: '1',
    },
    {
        name: "待接单",
        color: "#8080FF",
        tips: "请耐心等待，平台将安排房东/经纪人接单",
        workOrderState: '2',
    },
    {
        name: "已接单",
        color: "#F59A23",
        tips: "房东/经纪人已接单，请保持电话畅通，按约看房",
        workOrderState: '3'
    },
    {
        name: "已完成",
        color: "#02790E",
        tips: "看房已完成，待评价",
        workOrderState: '6'
    },
    {
        name: "已取消",
        color: "#999999",
        tips: "订单已取消",
        workOrderState: '7'
    },
    {
        name: "待审核",
        color: "#999999",
        tips: "待审核，请等待管理员审核",
        workOrderState: '8'
    },
    {
        name: "已评价",
        color: "#97C21C",
        tips: "已评价，祝您生活愉快",
        workOrderState: 'estimationFlag'
    }

]

//维修类型映射
export const maintenanceTypeMapping = [
    {
        label: "个人维修",
        value: "1"
    },
    {
        label: "公共维修",
        value: "2"
    }
]

//紧急程度映射
export const urgencyDegreeMapping = [
    {
        label: "普通",
        value: "1"
    },
    {
        label: "紧急",
        value: "2"
    },
    {
        label: "非常紧急",
        value: "3"
    }
]

//通用映射方法
export const commonMapping = function (mapping, value, label = 'label') {
    if (!value) return "";
    let obj = mapping.find(item => item.value === value);
    return obj ? obj[label] : "";
}

